<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="java.util.*, cs5226.util.StringUtil, cs5226.model.BaselineBean" %>

<%
	List baselinesList = null, snapshotIDList=null;
	if(null!=request.getAttribute("baselinesList"))
		baselinesList = (List) request.getAttribute("baselinesList");
	if(null!=request.getAttribute("snapshotIDList"))
		snapshotIDList = (List) request.getAttribute("snapshotIDList");
%>

<h2>Baseline Configuration</h2>
	
<br/><br/><br/>

<style>

table
{
border-collapse:collapse;
}
table,th, td
{
border: 1px solid gray;
}
</style>


		<%
			if (request.getAttribute("msg") != null) {
		%>
		<%=request.getAttribute("msg")%>
		<%
			}
		%>
	<form action='configbaseline-create'>
	<table border="0" width="50%">
		<tr height="30"><td colspan="2" align="center"><b>Create Baseline</b></td></tr>
		<tr>
			<td>Start Snapshot ID:&nbsp;</td>
			<td>
				<select name="startID">
					<option value=""></option>
					<%if(snapshotIDList!=null && snapshotIDList.size()>0){ 
						for(int i=0;i<snapshotIDList.size();i++){%>
							<option value="<%=(String) snapshotIDList.get(i)%>"><%=(String) snapshotIDList.get(i)%></option>
						<%}
					}%>
				</select>
			</td>	
		</tr>
		<tr>
			<td>End Snapshot ID:&nbsp;</td>
			<td>
				<select name="endID">
					<option value=""></option>
					<%if(snapshotIDList!=null && snapshotIDList.size()>0){ 
						for(int i=0;i<snapshotIDList.size();i++){%>
							<option value="<%=(String) snapshotIDList.get(i)%>"><%=(String) snapshotIDList.get(i)%></option>
						<%}
					}%>
				</select>
			</td>	
		</tr>
		<tr>
			<td>Baseline Name:&nbsp;</td>
			<td><input type="text" name="baselineNM"></td>	
		</tr>	
		<tr>
			<td align="center" colspan="2"><input type='submit' value='Create' class='button'/></td>	
		</tr>
	</table>
	</form>
	
	<br><br>
	
	<form action='configbaseline-delete'>
	<table border="0"  width="50%">
		<tr height="30"><td align="center"><b>Delete Baseline</b></td></tr>
		<tr>
			<td><b>Baseline Name:</b>&nbsp;
				<select name="baselineNMDel">
					<option value=""></option>
					<%if(baselinesList!=null && baselinesList.size()>0){ 
						for(int i=0;i<baselinesList.size();i++){%>
							<option value="<%=((cs5226.model.BaselineBean) baselinesList.get(i)).getBASELINE_NAME()%>">
							<%=((cs5226.model.BaselineBean) baselinesList.get(i)).getBASELINE_NAME()%></option>
						<%}
					}%>
				</select>
			</td>	
		</tr>
		<tr>
			<td align="center"><input type='submit' value='Delete' class='button'/></td>	
		</tr>
	</table>
	</form>

<script>
	$(function() {		
		$('.button').button();
	});
</script>